//
//  AirplaneInfo.m
//  SpaceStorm
//
//  Created by 祥 雍 on 13-5-26.
//  Copyright (c) 2013年 __MyCompanyName__. All rights reserved.
//
//  舰载机信息类

#import "AirplaneInfo.h"
#import "Variable.h"

@implementation AirplaneInfo

@synthesize airplaneId = _airplaneId;
@synthesize airplaneBig = _airplaneBig;
@synthesize airplaneMid = _airplaneMid;
@synthesize airplaneSmall = _airplaneSmall;
@synthesize level = _level;
@synthesize groupId = _groupId;
@synthesize name = _name;
@synthesize flag = _flag;
@synthesize equipFlag = _equipFlag;
@synthesize gold = _gold;
@synthesize buyGold = _buyGold;
@synthesize sellGold = _sellGold;
@synthesize airplaneNeedVolume = _airplaneNeedVolume;

@synthesize shield = _shield;
@synthesize shieldElectricityResistance = _shieldElectricityResistance;
@synthesize shieldBombResistance = _shieldBombResistance;
@synthesize shieldKineticResistance = _shieldKineticResistance;
@synthesize armoured = _armoured;
@synthesize armouredElectricityResistance = _armouredElectricityResistance;
@synthesize armouredBombResistance = _armouredBombResistance;
@synthesize armouredKineticResistance = _armouredKineticResistance;

@synthesize hp = _hp;
@synthesize field = _field;
@synthesize speed = _speed;
@synthesize accelerated = _accelerated;
@synthesize steeringForce = _steeringForce;
@synthesize type = _type;

@synthesize param1 = _param1;
@synthesize param2 = _param2;
@synthesize param3 = _param3;
@synthesize param4 = _param4;
@synthesize param5 = _param5;
@synthesize param6 = _param6;
@synthesize param7 = _param7;
@synthesize param8 = _param8;

@synthesize actionId = _actionId;
@synthesize icon = _icon;
@synthesize model = _model;
@synthesize description = _description;
@synthesize BGDescription = _BGDescription;

+(id) infoWithTbxml:(TBXMLElement *)tbxml
{
    return [[[self alloc] initWithTbxml:tbxml] autorelease]; 
}

-(id) initWithTbxml:(TBXMLElement *)tbxml
{
    self = [super init]; 
	
	if (self!= nil) 
    {
        //舰载机id	
        self.airplaneId = [[TBXML valueOfAttributeNamed:@"airplaneId" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"舰载机id:%d", self.airplaneId);
        
        //舰载机大类	
        self.airplaneBig = [[TBXML valueOfAttributeNamed:@"airplaneBig" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"舰载机大类:%d", self.airplaneBig);
        
        //舰载机中类	
        self.airplaneMid = [[TBXML valueOfAttributeNamed:@"airplaneMid" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"舰载机中类:%d", self.airplaneMid);
        
        //舰载机细类	
        self.airplaneSmall = [[TBXML valueOfAttributeNamed:@"airplaneSmall" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"舰载机细类:%d", self.airplaneSmall);
        
        //科技等级
        self.level = [[TBXML valueOfAttributeNamed:@"level" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"科技等级:%d", self.level);
        
        //小组编号
        self.groupId = [[TBXML valueOfAttributeNamed:@"groupId" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"小组编号:%d", self.groupId);
        
        //舰载机名
        self.name = [TBXML valueOfAttributeNamed:@"name" forElement:tbxml];
        if(showXMLLog == YES) CCLOG(@"舰载机名:%@", self.name);
        
        //舰载机标志
        self.flag = [[TBXML valueOfAttributeNamed:@"flag" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"舰载机标志:%d", self.flag);
        
        //装备标志	
        self.equipFlag = [[TBXML valueOfAttributeNamed:@"equipFlag" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"装备标志:%d", self.equipFlag);
        
        //金币	
        self.gold = [[TBXML valueOfAttributeNamed:@"gold" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"金币:%d", self.gold);
        
        //买入军费
        self.buyGold = [[TBXML valueOfAttributeNamed:@"buyGold" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"买入军费:%d", self.buyGold);
        
        //卖出军费	
        self.sellGold = [[TBXML valueOfAttributeNamed:@"sellGold" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"卖出军费:%d", self.sellGold);
        
        //舰载机需求挂仓容量	
        self.airplaneNeedVolume = [[TBXML valueOfAttributeNamed:@"airplaneNeedVolume" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"舰载机需求挂仓容量:%d", self.airplaneNeedVolume);
        
        //舰船护盾	
        self.shield = [[TBXML valueOfAttributeNamed:@"shield" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"舰船护盾:%d", self.shield);
        
        //护盾电抗	
        self.shieldElectricityResistance = [[TBXML valueOfAttributeNamed:@"shieldElectricityResistance" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"护盾电抗:%d", self.shieldElectricityResistance);
        
        //护盾爆抗	
        self.shieldBombResistance = [[TBXML valueOfAttributeNamed:@"shieldBombResistance" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"护盾爆抗:%d", self.shieldBombResistance);
        
        //护盾动抗	
        self.shieldKineticResistance = [[TBXML valueOfAttributeNamed:@"shieldKineticResistance" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"护盾动抗:%d", self.shieldKineticResistance);
        
        //舰船装甲
        self.armoured = [[TBXML valueOfAttributeNamed:@"armoured" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"舰船装甲:%d", self.armoured);
        
        //装甲电抗	
        self.armouredElectricityResistance = [[TBXML valueOfAttributeNamed:@"armouredElectricityResistance" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"装甲电抗:%d", self.armouredElectricityResistance);
        
        //装甲爆抗	
        self.armouredBombResistance = [[TBXML valueOfAttributeNamed:@"armouredBombResistance" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"装甲爆抗:%d", self.armouredBombResistance);
        
        //装甲动抗	
        self.armouredKineticResistance = [[TBXML valueOfAttributeNamed:@"armouredKineticResistance" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"装甲动抗:%d", self.armouredKineticResistance);
        
        //舰船结构
        self.hp = [[TBXML valueOfAttributeNamed:@"hp" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"舰船结构:%d", self.hp);
        
        //舰船视野	
        self.field = [[TBXML valueOfAttributeNamed:@"field" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"舰船视野:%d", self.field);
        
        //舰船速度	
        self.speed = [[TBXML valueOfAttributeNamed:@"speed" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"舰船速度:%d", self.speed);
        
        //加速力	
        self.accelerated = [[TBXML valueOfAttributeNamed:@"accelerated" forElement:tbxml] floatValue];
        if(showXMLLog == YES) CCLOG(@"加速力:%f", self.accelerated);
        
        //转向力	
        self.steeringForce = [[TBXML valueOfAttributeNamed:@"steeringForce" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"转向力:%d", self.steeringForce);
        
        //类型	
        self.type = [[TBXML valueOfAttributeNamed:@"type" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"类型:%d", self.type);
        
        //参数1功能	
        self.param1 = [[TBXML valueOfAttributeNamed:@"param1" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"参数1功能:%d", self.param1);
        
        //参数2功能	
        self.param2 = [[TBXML valueOfAttributeNamed:@"param2" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"参数2功能:%d", self.param2);
        
        //参数3功能	
        self.param3 = [[TBXML valueOfAttributeNamed:@"param3" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"参数3功能:%d", self.param3);
        
        //参数4功能	
        self.param4 = [[TBXML valueOfAttributeNamed:@"param4" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"参数4功能:%d", self.param4);
        
        //参数5功能	
        self.param5 = [[TBXML valueOfAttributeNamed:@"param5" forElement:tbxml] floatValue];
        if(showXMLLog == YES) CCLOG(@"参数5功能:%f", self.param5);
        
        //参数6功能	
        self.param6 = [[TBXML valueOfAttributeNamed:@"param6" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"参数6功能:%d", self.param6);
        
        //参数7功能	
        self.param7 = [[TBXML valueOfAttributeNamed:@"param7" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"参数7功能:%d", self.param7);
        
        //参数8功能	
        self.param8 = [[TBXML valueOfAttributeNamed:@"param8" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"参数8功能:%d", self.param8);
        
        //舰载机AI脚本
        self.actionId = [[TBXML valueOfAttributeNamed:@"actionId" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"舰载机AI脚本:%d", self.actionId);
        
        //图标	
        self.icon = [TBXML valueOfAttributeNamed:@"icon" forElement:tbxml];
        if(showXMLLog == YES) CCLOG(@"图标:%@", self.icon);
        
        //模型	
        self.model = [[TBXML valueOfAttributeNamed:@"model" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"模型:%d", self.model);
        
        //说明	
        self.description = [TBXML valueOfAttributeNamed:@"description" forElement:tbxml];
        if(showXMLLog == YES) CCLOG(@"说明:%@", self.description);
        
        //舰载机背景	
        self.BGDescription = [TBXML valueOfAttributeNamed:@"BGDescription" forElement:tbxml];
        if(showXMLLog == YES) CCLOG(@"舰载机背景:%@", self.BGDescription);
    }
    
    return self;

}
@end
